package com.addplus.townmall.server.api.model.town.expand;

import com.addplus.townmall.server.api.model.town.Area;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * 类名: AreaExpand
 *
 * @author zhangjiehang
 * @version V1.0
 * @date 2018/9/13 下午5:10
 * @description 类描述: 区域表返回实体类
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
public class AreaExpand extends Area implements Comparable<AreaExpand>{

    private List<AreaExpand> areaList;

    private List<Integer> areaIdList;

    @Override
    public int compareTo(AreaExpand o) {
        int oSort = o.getSort();
        if (this.getSort() > oSort) {
            return -1;
        }else if (this.getSort() < oSort) {
            return 1;
        }else{
            int id = o.getId();
            if(this.getId()>id){
                return 1;
            }else if(this.getId()<id){
                return -1;
            }
        }
        return 0;
    }
}
